﻿using System;
using CID.Support.Exceptions;
using CID.Domain.Operations;

namespace CID.Domain.Exceptions
{
    [Serializable]
    class InvalidAssignmentException : DomainException
    {
        public InvalidAssignmentException(IEnvironment environment) : this(environment.GetType().Name) { }
        public InvalidAssignmentException(IServer server) : this(server.GetType().Name) { }
        public InvalidAssignmentException(IServerRole serverRole) : this(serverRole.GetType().Name) { }

        private InvalidAssignmentException(string targetType) : base(String.Format("The Assignment operation can't be made as it doesn't belong to the target {0}", targetType)) { }
    }
}
